package com.xsr.blog.demo.javablacklistdesign.config;

import com.xsr.blog.demo.javablacklistdesign.Interceptor.BlackListInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @Author：xsr
 * @Date：2024/1/28 21:40
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Resource
    private BlackListInterceptor blackListInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(blackListInterceptor).addPathPatterns("/**");
    }

}
